<script type="text/javascript">

c.log( '123_123_123_foo_bar_123_'.cutFromBeg('ala', true) );
c.log( 'alaalaalaalaalamakota'.cutFromBeg('ala', false) );
c.log( 'alaalaalaalaalamakota'.cutFromBeg('ala') );

c.log( 'alaalaalaalaalamakotakotakota'.cutFromEnd('kota') );
c.log( 'alaalaalaalaalamakotakotakota'.cutFromEnd('kota', false) );

c.log( 'aaalaaa'.cutFromBoth('a') );

var s = new String('dddd');

</script>